import { PASS_MY_LIST} from "./actionsTypes";
export const passOrderList = data => ({type: PASS_MY_LIST, data: data});//选中的车牌号码
import getOrderListAll from  '../services/orderListService';
import { Toast } from 'antd-mobile'


export const getOrderList =(data,callBack)=>{
	return (dispatch, getState)=> {
		Toast.hide();
		Toast.loading("", 30, () => Toast.info("网络错误", 2));
		getOrderListAll.getOrderListAll(data).then(resultData => {
			Toast.hide();
			if (resultData.code == 1000) {
				dispatch(passOrderList(resultData.body.orderList))
				callBack(resultData.body.orderList)
			} else {
				Toast.info(resultData.msg);
			}
		});
	}
}



